﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Order.aspx.cs" Inherits="POS.Order" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <script src="http://code.jquery.com/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery.signalR-1.1.2.min.js" type="text/javascript"></script>
    <script src="signalr/hubs" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            // Proxy created on the fly          
            var order = $.connection.OrderHub;

            // Declare a function on the chat hub so the server can invoke it          
            chat.client.displayStatus = function (orderList) {
                getData(orderList);
            };

            // Start the connection
            $.connection.hub.start();
            getData(orderList);
        });

        function getData(orderList) {
            var $tbl = $('#tbl_OrderInfo');
            if (orderList.length > 0) {
                $tbl.empty();
                $tbl.append(' <tr><th>OrderID</th></tr>');
                var rows = [];
                for (var i = 0; i < orderList.length; i++) {
                    rows.push(' <tr><td>' + orderList[i] + '</td></tr>');
                }
                $tbl.append(rows.join(''));
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table id="tbl_OrderInfo" style="text-align:center;margin-left:10px">
        </table>
    </div>
    </form>
</body>
</html>
